<template>
  <div>
    <div class="box_bg">
      <ScaleBox class="bg" :width="1024" :height="768" bgc="#00060f" :delay="100" :isFlat="false">
        <div class="main-container chemicalProcess">
          <img @click="gotoSrc({ src: '/home/controlMode' })" class="back" src="../../../assets/back.png" alt="" />
          <div class="center_">
            <div class="nav_title">定时控制</div>
          </div>
          <div class="center_ jc">
            <div class="jc_boxs" @click="gotoSrc(item)" v-for="item in jcist.slice(0, 2)" :key="item.type">
              <img class="jc_img" :src="item.img" alt="" />
              <div>{{ item.name }}</div>
            </div>
          </div>
          <div class="center_ bottom">
            <div @click="gotoSrc(item)" class="jc_boxs" v-for="item in jcist.slice(2, 5)" :key="item.type">
              <img class="jc_img" :src="item.img" alt="" />
              <div>{{ item.name }}</div>
            </div>
          </div>
        </div>
      </ScaleBox>
    </div>
  </div>
</template>
<script>
// import store from '@/store'

import echarts from 'echarts'
import { login } from '@/api/time'
import ScaleBox from 'vue2-scale-box'
import moment from 'moment'
export default {
  components: {
    ScaleBox
  },
  data() {
    return {
      indexc: 0,
      jcist: [
        {
          img: require('../../../assets/kqwd.png'),
          name: '空气温度定时调控',
          type: '4',
          src: '/home/AirTemperatureRegulation'
        },
        {
          img: require('../../../assets/kqsd.png'),
          name: '空气湿度定时调控',
          type: '5',
          src: '/home/AirTemperatureRegulation'
        },
        {
          img: require('../../../assets/wfj.png'),
          name: 'CO2浓度定时调控',
          type: '2',
          src: '/home/AirTemperatureRegulation_c'
        },
        {
          img: require('../../../assets/dgds.png'),
          name: '土壤湿度定时调控',
          type: '1',
          src: '/home/AirTemperatureRegulation_c'
        },
        {
          img: require('../../../assets/dg.png'),
          name: '光照强度定时调控',
          type: '0',
          src: '/home/AirTemperatureRegulation_c'
        }
      ],
      boxList: [
        {
          img: require('../../../assets/home.png'),
          name: '首页',
          src: '/home/home'
        },
        {
          img: require('../../../assets/jc.png'),
          name: '在线监测',
          src: '/home/onlineMonitoring'
        },
        {
          img: require('../../../assets/kz_active.png'),
          name: '控制模式'
        },
        {
          img: require('../../../assets/xt.png'),
          name: '系统参数',
          src: '/home/system'
        }
      ]
    }
  },
  mounted() {
    this.login()
  },
  beforeDestroy() {},
  methods: {
    gotoSrc(val) {
      this.$router.push({
        path: val.src,
        query: {
          type: val.type,
          name: val.name
        }
      })
    },
    getIndx(val) {
      this.$router.push({
        path: val
      })
    }
  }
}
</script>
<style lang="less" scoped>
.bg {
  background: url('../../../assets/jc_bg.png') no-repeat center center;
  // width: 100vw;
  height: 100vh;
  width: 100vw;
  // background-color: #05032e;
  /*把背景图片放大到适合元素容器的尺寸，图片比例不变*/
  background-size: cover;
}
.box_bg {
  background-color: #011e7b !important;

  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
}
.center_ {
  display: flex;
  justify-content: center;
  .nav_title {
    font-family: 'MyCustomFont', sans-serif;
    display: flex;
    justify-content: center;
    // background: url('../assets/title.png') no-repeat center center;
    position: absolute;
    top: 20px;
    font-size: 42px;
    color: #ffffff;
    line-height: 58px;
    text-align: justify;
    font-style: normal;
    background: linear-gradient(90deg, #ffffff 0%, #0771ff 97%, #006dff 100%);
    -webkit-background-clip: text;
    color: transparent;

    .nav_t {
      font-weight: bolder;
      font-size: 34px;
      color: #3de6ff;
      line-height: 48px;
      text-align: center;
      font-style: normal;
      background: linear-gradient(90deg, #ffffff 0%, #02c2cb 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
  }
}
@font-face {
  font-family: 'MyCustomFont'; /* 定义字体的名称 */
  src: url('../../../assets/tt.ttf') format('truetype'); /* 指定字体文件的路径和格式 */
}
/* 自定义整个滚动条 */
::-webkit-scrollbar {
  width: 12px; /* 设置滚动条的宽度 */
}

/* 自定义滚动条轨道 */
::-webkit-scrollbar-track {
  background: transparent; /* 设置轨道的背景颜色 */
}

/* 自定义滚动条的滑块（thumb） */
::-webkit-scrollbar-thumb {
  background: #cceaf8; /* 设置滑块的背景颜色 */
  height: 12px;
}

/* 当滑块悬停或活动时，可以添加更多样式 */
::-webkit-scrollbar-thumb:hover {
  background: #555; /* 设置滑块在悬停状态下的背景颜色 */
}
/deep/.el-input-group__append {
  background-color: #387dff;
  color: #ffffff;
  cursor: pointer;
}
/deep/.el-input__icon {
  font-size: 42px;
  margin-top: 25px;
}
/deep/ .el-input__inner {
  font-weight: bold;
  font-size: 42px;
  color: #999999;
  text-align: left;
  height: 100px;
  font-style: normal;
  border: none;
  border-radius: 9px;
  padding-left: 60px;
  background: rgba(11, 63, 173, 0.72);
  border-radius: 20px 0 0 20px;
  border-image: radial-gradient(circle, rgba(51, 201, 255, 1), rgba(31, 104, 198, 1), rgba(102, 188, 255, 1)) 3 3;
}
.jc {
  position: absolute;
  top: 183px;
  left: 170px;
  width: 60%;
  display: flex;
  justify-content: space-between;

  // grid-template-areas: 'a b' 'c d e';

  .jc_boxs {
    margin-left: 70px;
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    width: 205px;
    font-weight: 500;
    font-size: 24px;
    color: #ffffff;
    cursor: pointer;
    .jc_img {
      width: 194px;
    }
  }
}
.bottom {
  position: absolute;
  width: 100%;
  bottom: 180px;
  display: flex;
  justify-content: space-around;
  .jc_boxs {
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    width: 205px;
    font-weight: 500;
    font-size: 24px;
    color: #ffffff;
    cursor: pointer;
    .jc_img {
      width: 194px;
    }
  }
}
.back {
  width: 60px;
  height: 60px;
  cursor: pointer;
  position: absolute;
  top: 30px;
  left: 41px;
}
</style>
